# $Id: PKGBUILD 78235 2012-10-17 10:26:18Z allan $
# Maintainer: Sébastien Luttringer <seblu@aur.archlinux.org>

pkgbase=python-progressbar
pkgname=('python-progressbar' 'python2-progressbar')
pkgver=2.3
pkgrel=4
arch=('any')
url='http://code.google.com/p/python-progressbar/'
license=('LGPL')
makedepends=('python' 'python-distribute' 'python2' 'python2-distribute')
source=("http://python-progressbar.googlecode.com/files/progressbar-$pkgver.tar.gz"
        '01-python33.patch')
sha1sums=('aebb94b452990468c77090fb43b335cf0a724353'
          '5dc63611e364e90441cbc90fe2530b9fab67e780')

build() {
  cd progressbar-$pkgver
  patch -p 1 -i "$srcdir"/01-python33.patch
  python setup.py build --build-lib=build/python
  python2 setup.py build --build-lib=build/python2
  find build/python2 -type f -exec \
    sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python2,' {} \;
}

package_python-progressbar() {
  pkgdesc='Text progressbar library for python'
  depends=('python')

  cd progressbar-$pkgver
  python setup.py build --build-lib=build/python \
                  install --root="$pkgdir" --optimize=1
}

package_python2-progressbar() {
  pkgdesc='Text progressbar library for python2'
  depends=('python2')

  cd progressbar-$pkgver
  python2 setup.py build --build-lib=build/python2 \
                   install --root="$pkgdir" --optimize=1
}

# vim:set ts=2 sw=2 et:
